
<template>
	<!-- 相册管理 -->
	<main-box>
		<div v-if="!queryInClass">
			<el-row :gutter="30">
				<el-col :span="3">
					<el-button type="text" style="font-size:0.18rem;color:#333333;font-weight:bold;" 
					>相册管理</el-button>
				</el-col>
			</el-row>
			<div>
				<el-row :gutter="10" style="margin-top:0.1rem;">
					<el-col :span="4">
						<el-select clearable style="width:100%;" v-model="searchParam.schoolYearId"></el-select>
					</el-col>
					<el-col :span="4">
						<el-input clearable placeholder="输入班级名称搜索" v-model="searchParam.className"></el-input>
					</el-col>
					<el-col :span="2">
						<el-button @click="search(1)">搜索</el-button>
					</el-col>
				</el-row>
				<el-row style="margin-top:0.1rem;">
					<table class="table" cellspacing="0">
						<thead class="thead">
							<tr>
								<td style="width: 4rem;">年级</td>
								<td style="width: 4rem;">班级</td>
								<td style="width: 4rem;">最近更新日期</td>
								<td style="width: 4rem;">照片总数</td>
								<td style="width: 4rem;">操作</td>
							</tr>
						</thead>
						<tbody class="tbody" v-if="albumList&&albumList.length>0">
							<tr v-for="(item,index) in albumList" :key="index">
								<td>{{item.gradeName}}</td>
								<td>{{item.className}}</td>
								<td>{{item.updateTime}}</td>
								<td>{{item.photoCount}}</td>
								<td>
									<el-button type="text" @click="queryRow(item)">查看</el-button>
								</td>
							</tr>
						</tbody>
						<tbody class="tbody" v-else>
							<tr>
								<td colspan="6" align="center">暂无数据</td>
							</tr>
						</tbody>
					</table>
				</el-row>
				<el-row>
					<el-pagination
						class="page"
						layout="total, sizes, prev, pager, next, jumper"
						:current-page="searchParam.currPage"
						@size-change="pageSizeChange"
						@current-change="curPageChange"
						:total="searchParam.total"
					></el-pagination>
				</el-row>
			</div>
		</div>
		<albumQuery v-else @back="queryInClass=false;"></albumQuery>
	</main-box>
</template>

<script>
	import albumQuery from './common/album_query'
	let vm;
	export default{
		components:{albumQuery},
		data(){
			return {
				queryInClass:false,
				searchParam:{
					campusId:this.$store.state.campusId,
					currPage:1,
					pageSize:10,
					total:0,
					schoolYearId:'',
					className:'',
				},
				albumList:[{}],
			}
		},
		methods:{
			init() {
				this.search(1);
			},
			campusChange : function(campusId) { //校区改变
				this.searchParam.campusId=campusId;
				this.init();
			},
			/**搜索 */
			search(pgIndex){
				this.searchParam.currPage=pgIndex||this.searchParam.currPage;
				// api.teachPlanGetPage(this.searchParam)
				// .then(function(data){
				// 	if(data.resultCode==2000){
				// 		vm.searchParam.total=data.totalCount;
				// 		vm.albumList=data.list;

				// 		vm.albumList.forEach(ele=>{
				// 			ele._useTime=ele.planStartTime.substr(0,10)+' 至 '+
				// 			ele.planEndTime.substr(0,10);

				// 		});
				// 	}
				// });
			},
			pageSizeChange(val){
				this.searchParam.pageSize = val;
      			this.search(1);
			},
			curPageChange(val){
				this.search(val);
			},
			queryRow(item){
				this.queryInClass=true;
			},
		},
		mounted(){
			vm=this;
			// let userInfo = tool.getItem(lsKey.user, true); //得到当前用户信息
			// this.orgId=userInfo.orgId;
			this.init();
		},
		computed:{
			
		},
		watch:{

		}
	}
</script>

<style lang="scss" scoped>
	


	/*自定义滚动条样式*/
	// .box-tasks::-webkit-scrollbar {
	// 	// height: 0.08rem;
	// 	width: 0.05rem;
	// }
	// .box-tasks::-webkit-scrollbar-thumb {
	// 	border-radius: 0.5rem;
	// 	background: #BBBBBB;
	// }
	// .box-tasks::-webkit-scrollbar-track {
	// 	background: rgba(242, 246, 252, 0);
	// }	

	
</style>
<style scoped src="@/style/module/table.css"></style>